'use strict';
const db = uniCloud.database()
const collection = db.collection('houselist')
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)
	const {id} = event
	if(id) {
		const res = await collection.where({
			_id: id
		}).get()
		return {
			code: 200,
			result: res.data
		}
	} else {
		return {
			code: '500',
			message: '请传入id进行查询'
		}
	}
};
